import java.io.FileNotFoundException;
import java.io.IOException;

import org.csource.fastdfs.ClientGlobal;
import org.csource.fastdfs.StorageClient;

/**
 * @(#)Main.java 2011-9-1 Copyright 2011 it.kedacom.com, Inc. All rights
 *               reserved.
 */

/**
 * (用一句话描述类的主要功能)
 * @author xiaojinghai
 * @date 2011-9-1
 */

public class Main {

	/**
	 * (用一句话描述方法的主要功能)
	 * @param args
	 * @throws Exception
	 * @throws IOException
	 * @throws FileNotFoundException
	 */

	public static void main(String[] args) throws FileNotFoundException, IOException, Exception {
		// TODO 该方法尚未实现
		ClientGlobal.init("./lib/fdfs_client.conf");
		StorageClient storageClient = new StorageClient();
		int r;

		// 上传
		String[] ret = storageClient.upload_file("./lib/fastdfs_client_v1.19.jar", "jar", null);
		System.out.println("group:" + ret[0]);
		System.out.println("fileName:" + ret[1]);

		// 下载
		// r = storageClient.download_file(ret[0], ret[1], "c:/temp/" + ret[1]);
		// System.out.println("下载状态：" + r);

		// 删除
		// r = storageClient.delete_file(ret[0], ret[1]);
		// System.out.println("删除状态：" + r);

		// storageClient.delete_file("group1",
		// "M00/00/00/rBAARk5fNLHhKzdEAAFSja5dsmw216.jar");
	}
}
